<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>get()方法</title>
</head>
<body>
    <div id="app">
        <h1>姓名： {{ msg.name }}</h1>
        <h1>年龄： {{ msg.age }}</h1>
        <button @click="post">Post方法</button>
    </div>
    <script type="text/javascript" src="../js/vue.min.js"></script>
    <script type="text/javascript">
        var vm = new Vue({
            el: '#app',
            data: {
                msg: {}
            },
            methods: {
                post() {
                    axios.post("/user", {
                        firstName: 'friend',
                        lastName: 'Flintstone'
                    }).then (function (response) {
                        console.log(response);
                    }).catch(function (error) {
                        console.log(error);
                    });
                }
            }
        })
    </script>
</body>
</html>